<!-- /* Description for file.
 * 右栏办公室首页表格+在线用户
 *
 * @copyright     Copyright 2008-2010, PHInfo Services Inc. (http://www.phinfoservices.com)
 * @package       ues
 * @subpackage    ues/app/views/enterprises
 * @since         ues
 * @version       V0.0.1
 * @modifiedby    张海杰2011年0601
 * @lastmodified  张朋2011年0708
 */-->

<?php
echo $html->css ( 'tab' );
echo $html->css ( 'tree' );
//ajax
echo $javascript->link('prototype/prototype-1.6.1');
echo $javascript->link('prototype/scriptaculous/scriptaculous'); 
?>
<script type="text/javascript">

 function ExChgClsName(Obj,NameA,NameB){
  var Obj=document.getElementById(Obj)?document.getElementById(Obj):Obj;
  Obj.className=Obj.className==NameA?NameB:NameA;
 }
 function showMenu(iNo){
 ExChgClsName("Menu_"+iNo,"MenuBox","MenuBox2");
 }

</script>
<!-- 导航菜单 -->
<div id="tabmenubar">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td class="tabmenubartitle1"><?php echo __("YourPosition");?></td>
		<td class="tabmenubartitle2"><?php echo __($nowPosition)?></td>
	</tr>
</table>
</div>

<!-- 列表区域-包含“最新公告”“设备使用情况”等 -->
<div class="tab_">

<!-- 最新公告 -->
<div id=nav1>
<table width="100%" cellpadding="0" cellspacing="0" border ="0">
	<tr>
		<td width="70px"><?php echo __("LatestNotices");?></td>
		<td>&nbsp;</td>
		<td width="30px"><?php echo $html->link(__("more", true), array('controller'=>'notices','action'=>'showlist')); ?></td>
	</tr>
</table>

<table width="100%" cellpadding="0" cellspacing="0" class="tab1">
	<tr>
		<th ><?php echo __("Subject");?></th>
		<th width="120px" ><?php echo __("CreateTime");?></th>
	</tr>
	<!-- Here's where we loop through our $Notes array, printing out post info --> 
	<?php foreach ($notices as $notice): ?>
		<tr class=normal onmouseover='this.className= "over " '
			onmouseup='this.className= "over " '
			onmouseout='this.className= "normal " '>
			<td><?php echo $html->link($notice['Notice']['title'],array('controller'=>'notices','action'=>'view', 'id'=>$notice['Notice']['id']));?></td>
			<td><?php echo $notice['Notice']['created']; ?></td>
		</tr> 
	<?php endforeach; ?>  
</table>
</div>
<!-- 最新公告 --> 

<!-- 设备使用情况 -->
<div id=nav style="display:none;">
<table width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<td width="100px"><?php echo __("EquipmentUseInfo");?></td>
		<td>&nbsp;</td>
		<td width="60px">
			<?php
			echo $html->link(__("BookEquipment", true), array('controller'=>'resourcebooks','action'=>'showlist')); ?>
		</td>
	</tr>
</table>

<table width="100%" cellpadding="0" cellspacing="0" class="tab1">
	<tr>
		<th><?php echo __("Subject");?></th>
		<th><?php echo __("EquipmentName");?></th>
		<th  width="120px" ><?php echo __("StartUseTime");?></th>
		<th  width="120px" ><?php echo __("EndUseTime");?></th>
	</tr>
	<?php foreach ($resourcebooks as $resourcebook): ?>
		<tr class=normal onmouseover='this.className= "over " '
			onmouseup='this.className= "over " '
			onmouseout='this.className= "normal " '>
			<td><?php echo $html->link($resourcebook['Resourcebook']['title'],array('controller'=>'Resourcebooks', 'action'=>'view', 'id'=>$resourcebook['Resourcebook']['id']));?>                 </td>
			<td><?php echo $resourcebook['Resource']['resourceName']; ?></td>
			<td><?php echo $resourcebook['Resourcebook']['startTime']; ?></td>
			<td><?php echo $resourcebook['Resourcebook']['endTime']; ?></td>
		</tr> 
	<?php endforeach; ?> 
</table>

</div>
<!-- 设备使用情况 -->

<!-- 今日日程 -->
<div id=nav1>
<table width="30%" cellpadding="0" cellspacing="1" class="title">
	<tr>
		<td width="70px">
		<a href="<?php echo ROOT_WEB_PATH . '/schedules/daySchedule/' . date('Y-m-d'); ?>" >今日日程</a>
			<?php //echo $html->link(__("TodayAgenda", true), array('controller'=>'schedules','action'=>'todaySchedule')); ?>
		</td>
		<td width="70px">
		<a href="<?php echo ROOT_WEB_PATH . '/schedules/weekSchedule/'; ?>" >本周日程</a>
			<?php //echo $html->link(__("WeeklyAgenda", true),array('controller'=>'schedules','action'=>'weekSchedule')); ?>
		</td>
		<td width="70px"><?php echo $html->link(__("AddAgenda", true), array('controller'=>'schedules','action'=>'addinit')); ?></td>
		<td></td>
	</tr>
</table>

<table width="100%" cellpadding="0" cellspacing="0" class="tab1" id="scheduleTable">
	<tr>
		<th width="30%"><?php echo __("Subject");?></th>
		<th width="120px" ><?php echo __("StartUseTime");?></th>
		<th width="10%"><?php echo __("Sender");?></th>
		<th width="40%"><?php echo __("Content");?></th>
	</tr>
	<?php foreach ($schedules as $schedule): ?>
		<tr class=normal onmouseover='this.className= "over "'
			onmouseup='this.className= "over "'
			onmouseout='this.className= "normal "'>
			<td><?php echo $html->link($schedule['Schedule']['title'],array('controller'=>'schedules','action'=>'view', 'id'=>$schedule['Schedule']['id']));?>                 </td>
			<td><?php echo $schedule['Schedule']['startDate']; ?></td>
			<td><?php echo $schedule['Schedule']['recipient']; ?></td>
			<td><?php echo $schedule['Schedule']['context']; ?></td>
		</tr> 
	<?php endforeach; ?> 
</table>
</div>
<!-- 今日日程 -->

<!-- 今日面试 -->
<div id=nav1>
<table width="20%" cellpadding="0" cellspacing="1" class="title">
	<tr>
		<td width="70px">
		<?php 
			echo $ajax->link(__("TodayInterview", true), 
								    array( 'controller' => 'interviewrecords', 'action' => 'todayInterview'), 
								    array( 'update' => 'interviewTable')
								    		//,complete' => "")
								);
		?>
			<?php //echo $html->link(__("TodayInterview", true), array('controller'=>'interviewrecords','action'=>'todayInterview'));?>
		</td>
		<td width="70px">
		<?php 
			echo $ajax->link(__("WeeklyInterview", true), 
								    array( 'controller' => 'interviewrecords', 'action' => 'weeklyInterview'), 
								    array( 'update' => 'interviewTable')
								    		//,complete' => "")
								);
		?>
			<?php //echo $html->link(__("WeeklyInterview", true), array('controller'=>'interviewrecords','action'=>'weekInterview')); ?>
		</td>
		<td></td>
	</tr>
</table>

<table width="100%" cellpadding="0" cellspacing="0" class="tab1" id="interviewTable">
	<tr>
		<th width="80px"><?php echo __("projectmanagementsprojectCode");?></th>
		<th width="50px" ><?php echo "轮次";?></th>
		<th width="80px"><?php echo __("候选人");?></th>
		<th width="120px"><?php echo __("visitorrecordsposition");?></th>
		<th width="120px"><?php echo __("interviewrecordsinterviewtime");?></th>
		<th width="120px"><?php echo __("interviewrecordsinterviewaddress");?></th>
		<th width="120px"><?php echo __("interviewrecordsinterviewfeedback");?></th>
		<th width="120px"><?php echo __("interviewrecordsmemo");?></th>
		
	</tr>
	<?php foreach ($interviewrecords as $interviewrecord): ?>
		<tr class=normal onmouseover='this.className= "over " '
			onmouseup='this.className= "over " '
			onmouseout='this.className= "normal " '>
			<td><?php echo $html->link($interviewrecord['Projectmanagement']['projectCode'],array('controller'=>'projectmanagements','action'=>'initProjectManage', 'id'=>$interviewrecord['Interviewrecord']['projectmanagement_id']));?>                 </td>
			<td><?php echo $interviewrecord['Interviewrecord']['interviewturn']; ?></td>
			<td><?php echo $interviewrecord['Candidate']['name']; ?></td>
			<td><?php echo $interviewrecord['Interviewrecord']['position']; ?></td>
			<td><?php echo $interviewrecord['Interviewrecord']['interviewtime']; ?></td>
			<td><?php echo $interviewrecord['Interviewrecord']['interviewaddress']; ?></td>
			<td><?php echo $interviewrecord['Interviewrecord']['interviewfeedback']; ?></td>
			<td><?php echo $interviewrecord['Interviewrecord']['memo']; ?></td>
		</tr> 
	<?php endforeach; ?> 
</table>
</div>
<!-- 今日面试 -->

<!-- 潜在客户/签约客户 -->
<div id=nav1>
<table width="30%" cellpadding="0" cellspacing="1" class="title">
	<tr>
		<td width="70px">
		<?php 
			echo $ajax->link(__("LatentCustomer", true), 
								    array( 'controller' => 'companymanages', 'action' => 'latentCustomer'), 
								    array( 'update' => 'companymanagesTable')
								    		//,complete' => "")
								);
		?>
			<?php //echo $html->link(__("LatentCustomer", true), array('controller'=>'companymanages','action'=>'latentCustomer')); ?>
		</td>
		<td width="70px">
			<?php 
			echo $ajax->link(__("SignedCustomer", true), 
								    array( 'controller' => 'companymanages', 'action' => 'signedCustomer'), 
								    array( 'update' => 'companymanagesTable')
								    		//,complete' => "")
								);
			?>
			<?php //echo $html->link(__("SignedCustomer", true), array('controller'=>'companymanages','action'=>'signedCustomer')); ?>
		</td>
		<td width="70px"><?php echo $html->link(__("AddCustomer", true), array('controller'=>'companymanages','action'=>'add')); ?></td>
		<td></td>
	</tr>
</table>

<table width="100%" cellpadding="0" cellspacing="0" class="tab1" id = "companymanagesTable">
	<tr>
		<th width="80px"><?php echo __("Companymanagename");?></th>
		<th width="50px" ><?php echo __("Companymanagetel");?></th>
		<th width="80px"><?php echo __("Companymanagecreater");?></th>
		<th width="120px"><?php echo __("Companylinkman");?></th>
		<th width="120px"><?php echo __("Companylinkposition");?></th>
		<th width="120px"><?php echo __("Companylinktel");?></th>
		<th width="120px"><?php echo __("Companylinkphone");?></th>
		<th width="10%"><?php echo __("CustomerState");?></th>
	</tr>
	<?php foreach ($companymanages as $companymanage): ?>
		<tr class=normal onmouseover='this.className= "over " '
			onmouseup='this.className= "over " '
			onmouseout='this.className= "normal " '>
			<td><?php echo $html->link($companymanage['Companymanage']['name'],array('controller'=>'companymanages', 'action'=>'initDetail', 'id'=>$companymanage['Companymanage']['id']));?></td>
			<td><?php echo $companymanage['Companymanage']['tel']; ?></td>
			<td><?php echo $companymanage['Companymanage']['creater']; ?></td>
			<td><?php echo $companymanage['Linkman']['linkman']; ?></td>
			<td><?php echo $companymanage['Position']['name']; ?></td>
			<?php if(empty($companymanage['Linkman']))
				echo "<td></td>";
				else
				echo "<td>".$companymanage['Linkman'][0]['tel']."</td>"; ?>
			<?php if(empty($companymanage['Linkman']))
				echo "<td></td>";
				else
				echo "<td>".$companymanage['Linkman'][0]['mobilePhone']."</td>"; ?>
			<td><?php echo $companymanage['Companymanage']['customerStatues']; ?></td>
		</tr> 
	<?php endforeach; ?> 
</table>
</div>
<!-- 潜在客户 -->

<!-- 项目列表 -->

<div id=nav1>
<table width="30%" cellpadding="0" cellspacing="1" class="title">
	<tr>
		<td width="70px"><?php echo __("ProjectList");?></td>
		<td width="70px"><?php echo $html->link(__("AddProject", true), array('controller'=>'projectmanagements','action'=>'save')); ?></td>
		<?php 
  if($isshow==1)
  {
?>
		<td width="70px"><?php echo $html->link(__("AllProject", true), array('controller'=>'projectmanagements','action'=>'allinfo')); ?></td>
<?php }?>		
		<td></td>
	</tr>
</table>

<table width="100%" cellpadding="0" cellspacing="0" class="tab1">
	<tr>
		<th width="70px"><?php echo __("projectmanagementsprojectCode");?></th>
		<th  width="70px" ><?php echo __("StartUseTime");?></th>
		<th width="120px"><?php echo __("Companymanagename");?></th>
		<th  width="120px" ><?php echo __("Companylinkposition");?></th>
		<th width="80px"><?php echo __("projectmanagementstotalEmployment");?></th>
		<th  width="100px" ><?php echo __("进度");?></th>
		<th  width="120px" ><?php echo __("项目备注");?></th>
		<th  width="120px" ><?php echo __("项目级别");?></th>

	</tr>
	<?php foreach ($projectmanagements as $projectmanagement): ?>
		<tr class=normal onmouseover='this.className= "over " '
			onmouseup='this.className= "over " '
			onmouseout='this.className= "normal " '>
			<td><?php echo $html->link($projectmanagement['Projectmanagement']['projectCode'],array('controller'=>'Projectmanagements','action'=>'initProjectManage', 'id'=>$projectmanagement['Projectmanagement']['id']),array('target'=>'_blank'));?>                 </td>
			<td><?php echo $projectmanagement['Projectmanagement']['projectDate']; ?></td>
<!--			<td><?php echo $projectmanagement['Projectmanagement']['projectCompany']; ?></td>-->
			<td><?php
					if(empty($projectmanagement['Projectmanagement']['company_id']))
						echo $projectmanagement['Projectmanagement']['projectCompany'];	
					else 
						echo $html->link($projectmanagement['Projectmanagement']['projectCompany'],array('controller'=>'Companymanages','action'=>'initDetail', 'id'=>$projectmanagement['Projectmanagement']['company_id']));
				?>                 
			</td>
<!--			<td><?php echo $projectmanagement['Projectmanagement']['projectCompanyPosition']; ?></td>-->
			<td><?php 
				if(empty($projectmanagement['Projectmanagement']['position_id']))
					echo $projectmanagement['Projectmanagement']['projectCompanyPosition'];
				else
					echo $html->link($projectmanagement['Projectmanagement']['projectCompanyPosition'],array('controller'=>'Companymanages','action'=>'seeposition', 'id'=>$projectmanagement['Projectmanagement']['position_id']));
				?>                 
			</td>
			<td><?php echo $projectmanagement['Projectmanagement']['totalEmployment']; ?></td>
			<td><?php echo $projectmanagement['Projectmanagement']['projectprocess']; ?></td>
			<td><?php echo $projectmanagement['Projectmanagement']['memo']; ?></td>
			<td><font color="red"><?php echo $projectmanagement['Projectmanagement']['projectLevel']; ?></font></td>
		</tr> 
	<?php endforeach; ?> 
</table>
</div>
<!-- 项目列表 -->
</div>

<div id="right-2">
<!-- 用户列表开始 -->
<div id="userlist">
<table width="100%" cellpadding="0" cellspacing="1" class="title">
	<tr>
		<th width="90px"><?php echo __("OnlineUsers");?></th>
		<th></th>
	</tr>
</table>

<div class="tree">
<h3></h3>
<div class="TreeWrap">
	<?php $i = 0;?>
	<?php foreach ($onlineUserDepartments as $k => $onlineUserDepartment){
			$i++;?>
		<div class="MenuBox" id="Menu_<?php echo $i;?>">
			<div class="titBox">
				<h3 class="Fst"><a href="javascript:showMenu(<?php echo $i;?>);"><?php echo $onlineUserDepartment;?></a></h3>
			</div>
			<div class="txtBox">
				<ul>
					<?php foreach ($onlineUsers[$k] as $onlineUser){
						$i++;?>
						<li><a href="#"><?php echo $onlineUser;?></a></li>
					<?php } ?> 
				</ul>
			</div>
		</div>
	<?php } ?> 
	
<!--MenuBox-->
</div>
</div>
</div>
</div>